from abc import ABC, abstractmethod
from logging import WARNING
from pathlib import Path

from utils.LogDecorator import LogDecorator


class CryptoProcessor(ABC):
    """加解密处理器抽象基类"""
    log = LogDecorator(name=__name__, level=WARNING)

    @abstractmethod
    def merge_and_encrypt(self, image_path: Path, archive_path: Path, output_path: Path):
        """合并并加密文件"""
        pass

    @abstractmethod
    def decrypt_and_extract(self, merged_path: Path, output_path: Path):
        """解密并提取文件"""
        pass

    def __str__(self) -> str:
        """获取工具名称"""
        return self.__class__.__name__
